raar.register
Class RAReal

java.lang.Object
  extended by raar.register.RAReal
All Implemented Interfaces:
java.io.Serializable, RAAssignable, RAEqualityComparable, RAFullComparable, RAMathObject, RAAllowed, RAAllowedEverywhere, RAAllowedInList, RAAllowedInType, RADataType, RAElemDataType, RANonElemDataType
Direct Known Subclasses:
RARandomReal

public class RAReal
extends java.lang.Object
implements RAAssignable, RADataType, RANonElemDataType, RAElemDataType, RAMathObject, RAAllowedEverywhere

Class Real represents a real (double precision number) in the RAAR environment.

See Also:
Serialized Form

Field Summary
static double TOLERANCE
          ABSOLUTE tolerance value for equals, largerEquals, smallerEquals, etcetera.
 
Constructor Summary
RAReal()
          Construct a real with NIL as default value.
RAReal(double value)
          Construct a real with specified value.
 
Method Summary
 boolean canContain(RAAllowed other)
           
 java.lang.Object clone()
           
 double dValue()
          Return the real value stored in this object.
 boolean equals(RAEqualityComparable otherMathObject)
          Returns true if this real is equal to the parameter, given the tolerance in the config file.
 int getType()
          Return the datatype (RADataType.RA_REAL)
 boolean larger(RAFullComparable r)
          Returns true if this real is larger than r, given the specific tolerance in the config file.
 boolean largerEquals(RAFullComparable r)
          Returns true if this real is larger than r or equals, given the specific tolerance in the config file.
 RAAllowed makeClone()
           
 boolean smaller(RAFullComparable r)
          Returns true if this real is smaller than r, given the specific tolerance in the config file.
 boolean smallerEquals(RAFullComparable r)
          Returns true if this real is smaller than r or equals r, given the specific tolerance in the config file.
 java.lang.String toString()
          String representation of this real.
 RADataType value()
          Return this object (for compatibility with RADataType).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOLERANCE

public static double TOLERANCE
ABSOLUTE tolerance value for equals, largerEquals, smallerEquals, etcetera.

Constructor Detail

RAReal

public RAReal()
Construct a real with NIL as default value.


RAReal

public RAReal(double value)
Construct a real with specified value.

Parameters:
the - value
Method Detail

clone

public java.lang.Object clone()
Specified by:
clone in interface RADataType
Overrides:
clone in class java.lang.Object

value

public RADataType value()
                 throws RAException
Return this object (for compatibility with RADataType).

Specified by:
value in interface RAAssignable
Specified by:
value in interface RAMathObject
Returns:
Duh...
Throws:
RAException

makeClone

public RAAllowed makeClone()
                    throws RAException
Specified by:
makeClone in interface RAAllowed
Throws:
RAException

dValue

public double dValue()
              throws RAException
Return the real value stored in this object.

Returns:
Duh...
Throws:
RAException

toString

public java.lang.String toString()
String representation of this real.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(RAEqualityComparable otherMathObject)
               throws RAException
Returns true if this real is equal to the parameter, given the tolerance in the config file. If the argument is null, false is returned.

Specified by:
equals in interface RAEqualityComparable
Parameters:
a - real...
Returns:
true or false
Throws:
RAException

canContain

public boolean canContain(RAAllowed other)
Specified by:
canContain in interface RAAllowed

larger

public boolean larger(RAFullComparable r)
               throws RAException
Returns true if this real is larger than r, given the specific tolerance in the config file. If the argument is null, false is returned.

Specified by:
larger in interface RAFullComparable
Parameters:
r - Another real bites the dust
Returns:
true or false, see above.
Throws:
RAException

smaller

public boolean smaller(RAFullComparable r)
                throws RAException
Returns true if this real is smaller than r, given the specific tolerance in the config file. If the argument is null, false is returned.

Specified by:
smaller in interface RAFullComparable
Parameters:
r - Another real bites the dust
Returns:
true or false, see above.
Throws:
RAException

largerEquals

public boolean largerEquals(RAFullComparable r)
                     throws RAException
Returns true if this real is larger than r or equals, given the specific tolerance in the config file.

Specified by:
largerEquals in interface RAFullComparable
Parameters:
r - Another real bites the dust
Returns:
true or false, see above.
Throws:
RAException

smallerEquals

public boolean smallerEquals(RAFullComparable r)
                      throws RAException
Returns true if this real is smaller than r or equals r, given the specific tolerance in the config file.

Specified by:
smallerEquals in interface RAFullComparable
Parameters:
r - Another real bites the dust
Returns:
true or false, see above.
Throws:
RAException

getType

public int getType()
Return the datatype (RADataType.RA_REAL)

Specified by:
getType in interface RADataType